Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: split associateAccountToChainArgs #730

Merged
merged 9 commits into from
Mar 7, 2023
Merged

Conversation

weichweich
Copy link
Contributor

fixes #2484

This makes it possible to use the high level associateAccountToChainArgs in most cases, but also use the building blocks in edge cases where parts are already done by other parts of the app (e.g. the wrapping of bytes).

Checklist:

  • I have verified that the code works
  • I have verified that the code is easy to understand
    • If not, I have left a well-balanced amount of inline comments
  • I have left the code in a better state
  • I have documented the changes (where applicable)

@Dudleyneedham
Copy link
Member

The linter failed...


const challenge = await getLinkingChallenge(did, validTill)

const predictedType = accountAddress.length === 20 ? 'ethereum' : 'sr25519'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wait we can't just assume it's an sr25519 address can we?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are only two different wrapping strategies. ethereum and the substrate way (sr25519, ed25519, ecdsa). So for anything not ethereum, we can just pretend it's one of the others. Doesn't make any difference which one we choose.

But yeah it's an ugly place in code. Don't really like it as well.

Copy link
Contributor

@rflechtner rflechtner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would we merge this before changing the challenge? Does that make sense?

Also, this does not change the signature of associateAccountToChainArgs right?

@weichweich
Copy link
Contributor Author

Would we merge this before changing the challenge? Does that make sense?

Also, this does not change the signature of associateAccountToChainArgs right?

I would change the challenge, if we decide to, in another PR.
Also the signature of associateAccountToChainArgs should remain untouched. I only want to expose the basic building blocks.

Copy link
Member

@ntn-x2 ntn-x2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beyond perhaps a suggestion to change "raw challenge" to something else, I have nothing else against it, and I am glad we caught this stuff before the next release 🚀

Copy link
Contributor

@rflechtner rflechtner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good, pls figure out why some account linking integration tests started failing with "signature unverifiable"

@rflechtner
Copy link
Contributor

rflechtner commented Mar 1, 2023

oh and pls wait for https://github.com/KILTprotocol/sdk-js/actions/runs/4223205084 to be merged and rebase/merge bc we're not actually testing ethereum linking rn

@rflechtner
Copy link
Contributor

Try again after merging fea185f. Seems broken to me tbh

@weichweich weichweich mentioned this pull request Mar 6, 2023
5 tasks
Copy link
Contributor

@rflechtner rflechtner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, let's merge this

@weichweich weichweich merged commit 6e32aef into develop Mar 7, 2023
@weichweich weichweich deleted the aw-eth-linking-low branch March 7, 2023 09:59
rflechtner pushed a commit that referenced this pull request Mar 14, 2023
…hainArgs` (#730)

This makes it possible to use the high level associateAccountToChainArgs in most cases,
but also use the building blocks in edge cases
where parts are already done by other parts of the app (e.g. the wrapping of bytes).

fixes [#2484](KILTprotocol/ticket#2484)

---------

Co-authored-by: Antonio <[email protected]>
rflechtner pushed a commit that referenced this pull request Mar 14, 2023
This makes it possible to use the high level associateAccountToChainArgs in most cases, but also use the building blocks in edge cases where parts are already done by other parts of the app (e.g. the wrapping of bytes).

fixes [#2484](KILTprotocol/ticket#2484)

---------

Co-authored-by: Antonio <[email protected]>
@rflechtner rflechtner mentioned this pull request Mar 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants